package com.sample.springbatch.repository;

import com.sample.springbatch.model.RepayOrderInfo;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;

/**
 * Created by zwg on 2017/8/9.
 */
public interface RepayOrderInfoRepository extends PagingAndSortingRepository<RepayOrderInfo,Long> {
    List<RepayOrderInfo> findByUserId(String userId);


    @Query(value = "select userId from RepayOrderInfo where bussDate=:bussDate")
    List<String> findUid(@Param(value = "bussDate") Date bussDate);

    @Query(value = "select user_id from repay_order_info where buss_date=:bussDate",nativeQuery = true)
    List<String> findUidNative(@Param(value = "bussDate") String bussDate);
}
